package biz.inspeed.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class RegularEx {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
//		String str = "12$34*56$78";
//		String[] dString = str.split("\\*");
//		System.out.println(dString.length);
		
		String str = "1$$2$$3$$";
		String[] strings = str.split("\\$");
		System.out.println(Arrays.asList(strings));
		List<String> list = cutStrings(str);
		System.out.println(list);
	}
	 
	public static List<String> cutStrings(String str){
		List<String> list = new ArrayList<String>();
		int sep = 0;
		while((sep = str.indexOf('$')) >= 0){
			list.add(str.substring(0, sep-1));
			str = str.substring(sep);
		}
		return list;
	}

}
